#include "tetrahedron.h"

//! Constructor
Tetrahedron::Tetrahedron(vec3 position, double lenght){
	this->position = position;
	this->azimuthX = 0.;
	this->azimuthY = 0.;
	this->azimuthZ = 0.;
	this->width = lenght;
	this->depth = sqrt(3*lenght*lenght/4);
	// centro^2 = depth^2/9 + length^2/4
	// height = sqrt(lenght^2 - centro^2)
	double squaredCenter = depth*depth/9 + lenght*lenght/4;
	this->height = sqrt( (lenght*lenght) - squaredCenter );

	this->edge = edge;

	rotateX = vec3( 1., 0., 0.);
	rotateY = vec3( 0., 1., 0.);
	rotateZ = vec3( 0., 0., 1.);
}
